
<div id = "form-content"  class="frmcontent">
    
</div>
<table class="layoutcol" style="width:98%;">
  <col width="30%"></col>
  <col width="70%"></col>

  <tr>
    <td class="left">
      <!-- Tree user -->
      <div style ="width:100%">
     
        <input type="button" id="viewpermission" value="Xem quyền" />
        <input type="button" id="setpermission" value="Phân quyền" />
        <input type="button" id="removepermission" value="Xóa quyền" />
        <input type="button" id="refreshTree" value="Tải lại" style="display:none;" />
        
        <div style ="width:100%">
          <input type="hidden" id="idNode" name="idNode" value="" />
          <input type="hidden" id="nameNode" name="nameNode" value="" />
          <input type="text" value="" autocomplete="off" class="textbox" id = "searchNodes" name = "searchNodes">
          <!-- <input type = "button" class = "link-button clsearch" load="true" id = "searchNode"> -->
        </div>
        <div id="jsTree" class="jsTree"></div>
      </div>
    </td>
    <td>
      <!-- Thong tin quyen -->

      <div id = "form-content"  class="frmcontent">
          <div class="ti-tabs">
              <ul class="idTabs">
                  <li><a class="selected" id="Tab01" href="#Tab-01">DANH SÁCH QUYỀN</a></li>
                  <li><a class="" id="Tab02" href="#Tab-02">CẬP NHẬT QUYỀN</a></li>
              </ul> 
              <div id="Tab-01" class="content" style="display: none;">
                  <form>
                      <div id="dsplist" style="clear:both">
                        <table cellpadding="0" cellspacing="0" border="0" align="center" class="list-table-data" id="table-data" style="width:100%;">
                        <colgroup>
                            <col width="5%"></col>
                            <col width="70%"></col>
                            <col width="25%"></col>
                        </colgroup>
                        <tr class="header">
                          <td>#</td>
                          <td>Quyền xử lý</td>
                          <td>Mặc định</td>
                        </tr>
                         <?php
                          // if($count < 15){  
                          //   echo Clound_String::_addEmptyRow(0,15,3);   
                          // }
                          ?>
                        </table>

                      </div>
                  </form>
              </div>
              <div id="Tab-02" class="content" style="display: none;">
                  <form>
                      <input type="hidden" id="hdn_staffid" name="hdn_staffid" />
                      <table id="permision_detail" cellpadding="0" cellspacing="0" border="0" align="center" class="list-table-data" id="" style="width:60%;">
                        <colgroup>
                            <col width="10%"></col>
                            <col width="70%"></col>
                            <col width="20%"></col>
                        </colgroup>
                        <tr class="header">
                          <td><input type="checkbox" name="check-all-item" onclick="checkall(this,'check-item')" value="1" /></td>
                          <td>Quyền xử lý</td>
                          <td>Mặc định</td>
                        </tr>
                        <?php
                          $htmls ='';
                          $arrPerType = $this->arrPerType;
                          for ($i=0; $i < sizeof($arrPerType); $i++) { 
                              $htmls .= '<tr><td align="center"><input type="checkbox" name="check-item" id="check-item" value="'.$arrPerType[$i]['Code'].'" /></td>';
                              $htmls .= '<td>'.$arrPerType[$i]['Name'].'</td>';
                              $htmls .= '<td align="center"><input type="checkbox" name="item-default" id="item-default" value="1" /></td></tr>';
                          }
                          echo $htmls;
                        ?>
                        </table>
                        <div style="text-align:center;">
                          <input type="button" id="Save" name="Save" value="Save" />
                        </div>
                  </form>
              </div>  
          </div>
      </div>
    </td>
  </tr>
</table>

<script type="text/javascript">
  var dPermission = new System_Admin_Permission({module: 'system', controller: 'permission'});
  var arrPerType = $.parseJSON('<?= Zend_Json::encode($this->arrPerType)?>');
  $(".idTabs").idTabs();
  function checkall (obj,item) {
     var oTable = $(obj).parent().parent().parent();
        $(oTable).find('input[type="checkbox"][name="'+item+'"]').attr('checked',false);
     if($(obj).is(':checked')){
        $(oTable).find('input[type="checkbox"][name="'+item+'"]').trigger('click');
     }else{
     }
  }

</script>